package lcr;

public class Test0024 {
}
class Solution0024_1 {
    public ListNode reverseList(ListNode head) {
        ListNode ans = new ListNode();
        while (head!=null){
            ListNode temp = head.next;
            head.next=ans.next;
            ans.next=head;
            head=temp;
        }


        return ans.next;
    }
}
